package com.hexb.arithmetic.bitmap
{
	import flash.display.BitmapData;
	import flash.geom.ColorTransform;
	import flash.geom.Matrix;
	import flash.geom.Rectangle;

	public class BitmapTools
	{
		public function BitmapTools()
		{
		}
		
		/**裁剪图片*/
		 static public function getCutBitmap(source:BitmapData,rect:Rectangle,tx:Number,ty:Number):BitmapData{
			var mapData:BitmapData = new BitmapData(rect.width,rect.height,true,0);
			var matrix:Matrix = new Matrix(1,0,0,1,-tx,-ty);
			mapData.draw(source,matrix);
			return mapData;
		}
	}
}